<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>社交网站导航样式展示</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        :root {
            --primary: #4f46e5;
            --primary-light: #f0f4ff;
            --secondary: #64748b;
            --light: #f8fafc;
            --dark: #1e293b;
            --success: #10b981;
            --danger: #ef4444;
            --warning: #f59e0b;
            --border: #e2e8f0;
            --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
            --shadow-hover: 0 10px 15px rgba(0, 0, 0, 0.1);
        }
        
        body {
            font-family: 'Inter', system-ui, sans-serif;
            background-color: #f8fafc;
            color: var(--dark);
            padding-top: 20px;
        }
        
        .section-title {
            margin-bottom: 1.5rem;
            padding-bottom: 0.75rem;
            border-bottom: 2px solid var(--primary);
            display: inline-block;
        }
        
        .nav-demo {
            background-color: white;
            border-radius: 0.5rem;
            box-shadow: var(--shadow);
            padding: 1.5rem;
            margin-bottom: 2rem;
        }
        
        .nav-description {
            color: var(--secondary);
            margin-bottom: 1rem;
            font-size: 0.95rem;
        }
        
        /* 顶部导航栏样式 */
        .navbar-custom {
            background-color: white;
            box-shadow: var(--shadow);
        }
        
        .navbar-custom .navbar-brand {
            color: var(--primary);
            font-weight: 600;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        
        .navbar-custom .nav-link {
            color: var(--dark);
            margin-right: 1rem;
            transition: color 0.2s;
        }
        
        .navbar-custom .nav-link:hover,
        .navbar-custom .nav-link.active {
            color: var(--primary);
        }
        
        .navbar-custom .dropdown-menu {
            border: none;
            box-shadow: var(--shadow-hover);
            border-radius: 0.5rem;
        }
        
        .navbar-custom .dropdown-item:hover {
            background-color: var(--primary-light);
            color: var(--primary);
        }
        
        /* 侧边导航样式 */
        .sidebar-nav {
            background-color: white;
            border-radius: 0.5rem;
            box-shadow: var(--shadow);
            padding: 1rem 0;
        }
        
        .sidebar-nav .nav-item {
            margin-bottom: 0.25rem;
        }
        
        .sidebar-nav .nav-link {
            color: var(--dark);
            padding: 0.75rem 1.5rem;
            transition: all 0.2s;
            border-left: 3px solid transparent;
        }
        
        .sidebar-nav .nav-link:hover {
            background-color: var(--primary-light);
            color: var(--primary);
        }
        
        .sidebar-nav .nav-link.active {
            background-color: var(--primary-light);
            color: var(--primary);
            border-left-color: var(--primary);
            font-weight: 500;
        }
        
        .sidebar-nav .nav-link i {
            margin-right: 0.75rem;
            width: 20px;
            text-align: center;
        }
        
        /* 底部导航样式 */
        .bottom-nav {
            background-color: white;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
            padding: 0.75rem 0;
            position: relative;
        }
        
        .bottom-nav .nav-link {
            color: var(--secondary);
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 0.5rem;
            font-size: 0.75rem;
        }
        
        .bottom-nav .nav-link i {
            font-size: 1.25rem;
            margin-bottom: 0.25rem;
        }
        
        .bottom-nav .nav-link.active {
            color: var(--primary);
        }
        
        /* 标签式导航样式 */
        .tab-nav .nav-tabs {
            border-bottom: 1px solid var(--border);
            margin-bottom: 1rem;
        }
        
        .tab-nav .nav-link {
            color: var(--secondary);
            border: none;
            padding: 0.75rem 1.5rem;
            position: relative;
        }
        
        .tab-nav .nav-link.active {
            color: var(--primary);
            font-weight: 500;
        }
        
        .tab-nav .nav-link.active::after {
            content: '';
            position: absolute;
            bottom: -1px;
            left: 0;
            width: 100%;
            height: 3px;
            background-color: var(--primary);
        }
        
        /*  Pills导航样式 */
        .pills-nav .nav-pills .nav-link {
            color: var(--dark);
            background-color: var(--light);
            border-radius: 999px;
            padding: 0.5rem 1.25rem;
            margin-right: 0.5rem;
        }
        
        .pills-nav .nav-pills .nav-link.active {
            background-color: var(--primary);
            color: white;
        }
        
        /* 图标导航样式 */
        .icon-nav .nav-link {
            color: var(--secondary);
            display: flex;
            flex-direction: column;
            align-items: center;
            padding: 1rem;
            transition: all 0.2s;
        }
        
        .icon-nav .nav-link:hover,
        .icon-nav .nav-link.active {
            color: var(--primary);
            background-color: var(--primary-light);
            border-radius: 0.5rem;
        }
        
        .icon-nav .nav-link i {
            font-size: 1.5rem;
            margin-bottom: 0.5rem;
        }
        
        /* 移动端响应式调整 */
        @media (max-width: 768px) {
            .pills-nav .nav-pills {
                flex-wrap: wrap;
            }
            
            .pills-nav .nav-pills .nav-link {
                margin-bottom: 0.5rem;
            }
        }
    </style>
</head>
<body>
    <div class="container">
        <h1 class="mb-4">社交网站导航样式展示</h1>
        
        <!-- 顶部导航栏 -->
        <div class="nav-demo">
            <h3 class="section-title">1. 顶部导航栏</h3>
            <p class="nav-description">适合桌面端社交网站的主导航，包含品牌标识、主要导航项、用户操作和下拉菜单。</p>
            
            <nav class="navbar navbar-expand-lg navbar-custom">
                <div class="container-fluid">
                    <a class="navbar-brand" href="#">
                        <i class="fas fa-users"></i>
                        <span>社交圈</span>
                    </a>
                    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#mainNav">
                        <span class="navbar-toggler-icon"></span>
                    </button>
                    
                    <div class="collapse navbar-collapse" id="mainNav">
                        <ul class="navbar-nav me-auto">
                            <li class="nav-item">
                                <a class="nav-link active" href="#">首页</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">发现</a>
                            </li>
                            <li class="nav-item">
                                <a class="nav-link" href="#">消息</a>
                            </li>
                            <li class="nav-item dropdown">
                                <a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown">
                                    更多
                                </a>
                                <ul class="dropdown-menu">
                                    <li><a class="dropdown-item" href="#">群组</a></li>
                                    <li><a class="dropdown-item" href="#">活动</a></li>
                                    <li><a class="dropdown-item" href="#">收藏</a></li>
                                    <li><hr class="dropdown-divider"></li>
                                    <li><a class="dropdown-item" href="#">设置</a></li>
                                </ul>
                            </li>
                        </ul>
                        
                        <div class="d-flex align-items-center gap-3">
                            <button class="btn btn-outline-primary">登录</button>
                            <button class="btn btn-primary">注册</button>
                        </div>
                    </div>
                </div>
            </nav>
        </div>
        
        <!-- 侧边导航 -->
        <div class="nav-demo">
            <h3 class="section-title">2. 侧边导航</h3>
            <p class="nav-description">适合后台管理或内容分类较多的社交平台，提供清晰的层级结构。</p>
            
            <div class="row">
                <div class="col-md-3">
                    <ul class="nav flex-column sidebar-nav">
                        <li class="nav-item">
                            <a class="nav-link active" href="#">
                                <i class="fas fa-home"></i>
                                首页
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-user"></i>
                                个人资料
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-users"></i>
                                我的群组
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-comment"></i>
                                消息中心
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-bell"></i>
                                通知
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-bookmark"></i>
                                收藏
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-cog"></i>
                                设置
                            </a>
                        </li>
                    </ul>
                </div>
                <div class="col-md-9">
                    <div class="p-3 border rounded bg-light">
                        主内容区域示例
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 底部导航 -->
        <div class="nav-demo">
            <h3 class="section-title">3. 底部导航</h3>
            <p class="nav-description">适合移动设备的社交应用，在屏幕底部提供关键功能入口，方便单手操作。</p>
            
            <div style="max-width: 400px; margin: 0 auto;">
                <nav class="bottom-nav">
                    <ul class="nav justify-content-around">
                        <li class="nav-item">
                            <a class="nav-link active" href="#">
                                <i class="fas fa-home"></i>
                                <span>首页</span>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-compass"></i>
                                <span>发现</span>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-plus-circle"></i>
                                <span>发布</span>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-comment"></i>
                                <span>消息</span>
                            </a>
                        </li>
                        <li class="nav-item">
                            <a class="nav-link" href="#">
                                <i class="fas fa-user"></i>
                                <span>我的</span>
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
        </div>
        
        <!-- 标签式导航 -->
        <div class="nav-demo">
            <h3 class="section-title">4. 标签式导航</h3>
            <p class="nav-description">适合内容分类展示，如社交平台的动态、话题、推荐等不同内容板块切换。</p>
            
            <div class="tab-nav">
                <ul class="nav nav-tabs">
                    <li class="nav-item">
                        <a class="nav-link active" data-bs-toggle="tab" href="#tab1">关注动态</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" data-bs-toggle="tab" href="#tab2">热门话题</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" data-bs-toggle="tab" href="#tab3">推荐内容</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" data-bs-toggle="tab" href="#tab4">附近动态</a>
                    </li>
                </ul>
                
                <div class="tab-content">
                    <div class="tab-pane fade show active" id="tab1">
                        <p>关注的人的最新动态内容...</p>
                    </div>
                    <div class="tab-pane fade" id="tab2">
                        <p>当前最热门的话题和讨论...</p>
                    </div>
                    <div class="tab-pane fade" id="tab3">
                        <p>为您推荐的个性化内容...</p>
                    </div>
                    <div class="tab-pane fade" id="tab4">
                        <p>您附近的人发布的内容...</p>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- Pills导航 -->
        <div class="nav-demo">
            <h3 class="section-title">5. Pills导航</h3>
            <p class="nav-description">适合筛选不同类型的内容，如社交平台中的内容类型、时间范围等筛选条件。</p>
            
            <div class="pills-nav">
                <ul class="nav nav-pills">
                    <li class="nav-item">
                        <a class="nav-link active" data-bs-toggle="pill" href="#pill1">全部内容</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" data-bs-toggle="pill" href="#pill2">图片</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" data-bs-toggle="pill" href="#pill3">视频</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" data-bs-toggle="pill" href="#pill4">文章</a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" data-bs-toggle="pill" href="#pill5">话题</a>
                    </li>
                </ul>
                
                <div class="tab-content mt-3">
                    <div class="tab-pane fade show active" id="pill1">
                        <p>所有类型的内容展示...</p>
                    </div>
                    <div class="tab-pane fade" id="pill2">
                        <p>图片类型的内容展示...</p>
                    </div>
                    <div class="tab-pane fade" id="pill3">
                        <p>视频类型的内容展示...</p>
                    </div>
                    <div class="tab-pane fade" id="pill4">
                        <p>文章类型的内容展示...</p>
                    </div>
                    <div class="tab-pane fade" id="pill5">
                        <p>话题类型的内容展示...</p>
                    </div>
                </div>
            </div>
        </div>
        
        <!-- 图标导航 -->
        <div class="nav-demo">
            <h3 class="section-title">6. 图标导航</h3>
            <p class="nav-description">简洁直观的图标式导航，适合功能入口或快捷操作区。</p>
            
            <div class="icon-nav">
                <ul class="nav justify-content-around flex-wrap">
                    <li class="nav-item">
                        <a class="nav-link active" href="#">
                            <i class="fas fa-user-plus"></i>
                            <span>添加好友</span>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">
                            <i class="fas fa-images"></i>
                            <span>相册</span>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">
                            <i class="fas fa-video"></i>
                            <span>直播</span>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">
                            <i class="fas fa-calendar-alt"></i>
                            <span>活动</span>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">
                            <i class="fas fa-shopping-bag"></i>
                            <span>商城</span>
                        </a>
                    </li>
                    <li class="nav-item">
                        <a class="nav-link" href="#">
                            <i class="fas fa-gamepad"></i>
                            <span>游戏</span>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
    <script>
        // 为导航项添加点击事件，实现激活状态切换
        document.querySelectorAll('.nav-link').forEach(link => {
            link.addEventListener('click', function(e) {
                // 如果是下拉菜单或标签页，则不处理（由Bootstrap自动处理）
                if (this.getAttribute('data-bs-toggle') === 'dropdown' || 
                    this.getAttribute('data-bs-toggle') === 'tab') {
                    return;
                }
                
                // 移除同一导航组中其他项的active类
                const navItems = this.closest('.nav').querySelectorAll('.nav-link');
                navItems.forEach(item => item.classList.remove('active'));
                
                // 为当前点击项添加active类
                this.classList.add('active');
            });
        });
    </script>
</body>
</html>
    
